package com.gdglc.spring.biz.auth;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.github.pagehelper.PageInfo;
import com.y2.authprj.bean.auth.model.FunctionauthorityInfo;
import com.y2.authprj.bean.auth.model.StaffInfo;
import com.y2.authprj.exception.BizException;

public interface FunctionauthorityBiz{

	/**
	 * 查询全部资源权限信息
	 * @return
	 */
	public List<FunctionauthorityInfo> findAll() throws BizException;
	
	/**
	 * 根据父节点查找对应的资源对象
	 * @param parentId
	 * @return
	 */
	public List<FunctionauthorityInfo> findAllByParentId(Integer parentId);
	
	public void add(FunctionauthorityInfo fInfo) throws BizException;
	
	public void del(Integer id) throws BizException;
	
	public List<FunctionauthorityInfo> findAllByName(String name) throws BizException;

	public List<Integer> findFunctionauthorityIdByStaffId(@Param(value="staffId") int staffId);

	/**
	 * 添加是检查同一个父节点下面的资源名称,值是否有相同
	 * @param functionauthorityInfo
	 * @return
	 */
	public int findAllByParentIdAndName(FunctionauthorityInfo functionauthorityInfo);
	
	
	List<FunctionauthorityInfo> queryByChose(FunctionauthorityInfo functionauthorityInfo);

	PageInfo<FunctionauthorityInfo> queryByPage(FunctionauthorityInfo functionauthorityInfo,Integer pageNo,Integer pageSize) ;

	PageInfo<FunctionauthorityInfo> findAllByName(String name,Integer pageNo,Integer pageSize);
	PageInfo<FunctionauthorityInfo> findAllByParentId(Integer parentId,Integer pageNo,Integer pageSize);
}
